﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="goods_comment.aspx.cs" Inherits="cn_goods_comment" %>


<%@ Register Src="~/cn/UserControl/header.ascx" TagName="header" TagPrefix="uc1" %>
<%@ Register Src="~/cn/UserControl/top_ad.ascx" TagName="top_ad" TagPrefix="uc2" %>
<%@ Register Src="~/cn/UserControl/channel_navigation.ascx" TagName="channel_navigation"
    TagPrefix="uc3" %>
<%@ Register Src="~/cn/UserControl/bottom_ad.ascx" TagName="bottom_ad" TagPrefix="uc4" %>
<%@ Register Src="~/cn/UserControl/footer.ascx" TagName="footer" TagPrefix="uc5" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>商品评价，<%=(new Web.Old_App_Code.BasicSet()).TitleBind() %></title>
    <meta name="Keywords" content="商品评价，<%=(new Web.Old_App_Code.BasicSet()).KeywordBind() %>" />
    <meta name="Description" content="商品评价，<%=(new Web.Old_App_Code.BasicSet()).DescriptionBind() %>" />
    <link href="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>css/public.css"
        type="text/css" rel="stylesheet" />
    <link href="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>css/layout.css"
        type="text/css" rel="stylesheet" />

    <script language="Javascript" type="text/javascript" src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>js/jquery-1.6.2.min.js"></script>

    <!-- banner 图片展示效果 -->

    <script src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>js/channel/slider.js"
        type="text/javascript"></script>

    <!--登陆注册 弹出窗口-->
    <style type="text/css" media="all">
        @import "<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>js/login/thickbox.css";
    </style>
    <link href="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>js/login/1024.css"
        type="text/css" rel="alternate stylesheet" title="1024 x 768" />

    <script src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>js/login/thickbox.js"
        type="text/javascript"></script>

    <script src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>js/login/global.js"
        type="text/javascript"></script>

    <!-- 头部全部分类 三级导航-->

    <script type="text/javascript" src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>js/allmenu.js"></script>

    <link href="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>art_dialog/skins/idialog.css"
        rel="stylesheet" />

    <script type="text/javascript" src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>art_dialog/artDialog.js"></script>

    <script type="text/javascript" src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>art_dialog/plugins/iframeTools.source.js"></script>

    <script type="text/javascript" src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>js/art_dialog.js"></script>

    <script type="text/javascript">
        $(function () {
            $("#btnScoreSubmit").click(function () {
                if ($("input[name='commodityScore']:checked").val() == null) {
                    art.dialog.tips("请选择星级！", 1.5);
                    return false;
                } else {
                    $.ajax({
                        type: "POST",
                        url: "commodity_score.ashx",
                        data: "id=" + $("#hdGoods").val() + "&score=" + $("input[name='commodityScore']:checked").val(),
                        success: function (msg) {
                            $("#spCommodityScore").html("");
                            if (msg == "0") {
                                TB_show(null, "login.html?TB_iframe=true&height=370&width=640", false);
                            }
                            else if (msg == "1") {
                                art.dialog.tips("很抱歉，评分失败！", 1.5);
                            } else {
                                art.dialog.tips("恭喜您，评分成功！", 1.5);
                                $('#formScore')[0].reset(); //表单重置
                            }
                        }
                    });
                    return false;
                }
            });
            $("#btnGoodsComment").click(function () {
                if ($("#txtaContent").val() == "") {
                    $("#txtaContent").select();
                    $("#spContent").html("<img src=\"<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/wrong.gif\" />请输入评论内容！");
                    return false;
                } else {
                    if ($("#txtaContent").val().length > 500) {
                        $("#txtaContent").select();
                        $("#spContent").html("<img src=\"<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/wrong.gif\" />评论内容不能超过500个字符！");
                        return false;
                    } else $("#spContent").html("<img src=\"<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/right.gif\" />");
                }
                if ($("#txtCommentCode").val() == "") {
                    $("#txtCommentCode").select();
                    $("#spCommentCode").html("<img src=\"<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/wrong.gif\" />请输入验证码！");
                    return false;
                } else $("#spCommentCode").html("<img src=\"<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/right.gif\" />");
                $.ajax({
                    type: "POST",
                    url: "goods_comment.ashx",
                    data: "id=" + $("#hdGoods").val() + "&contact=" + escape($("#txtContact").val()) + "&content=" + escape($("#txtaContent").val()) + "&code=" + $("#txtCommentCode").val(),
                    success: function (msg) {
                        if (msg == "0") {
                            TB_show(null, "login.html?TB_iframe=true&height=370&width=640", false);
                        } else if (msg == "1") {
                            $("#txtCommentCode").select();
                            $("#spCommentCode").html("<img src=\"<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/wrong.gif\" />验证码错误，请重新输入！");
                            $("#imgCheckCommentCode").attr("src", "/code.aspx?a=" + Math.random() + "&t=conmment");
                        } else if (msg == "2") {
                            art.dialog.tips("很抱歉，评论失败！", 1.5);
                        }
                        else {
                            art.dialog.tips("恭喜您，评论成功！", 1.5);
                            $("#goods_comment").html(msg);
                            $('#formComment')[0].reset(); //表单重置
                            $("#spContent").html("*最多可输入200个字符");
                            $("#spCommentCode").html("");
                            $("#imgCheckCommentCode").attr("src", "/code.aspx?a=" + Math.random() + "&t=conmment");
                        }
                    }
                });
                return false;
            });
        });
    </script>

</head>
<body>
    <uc1:header ID="Header1" runat="server" />
    <uc2:top_ad ID="Top_ad1" runat="server" />
    <div class="container message">
        <div class="tab-content comment_pages">
            <!--<h1>在线留言</h1>-->
            <div class="comment_title ">
                <a href="#comment">我要评价</a><%Response.Write(GoodsNameBind()); %>
            </div>
            <span class="clear"></span><a name="comment"></a>
            <div class="tabcontain comment_list">
                <form id="formScore" action="" defaultbutton="btnScoreSubmit">
                    <ul>
                        <li class="first_li">商品评分</li>
                        <li>
                            <input type="radio" name="commodityScore" value="1" /><img src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/star01.gif"
                                alt="一星级" /></li>
                        <li>
                            <input type="radio" name="commodityScore" value="2" /><img src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/star02.gif"
                                alt="二星级" /></li>
                        <li>
                            <input type="radio" name="commodityScore" value="3" /><img src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/star03.gif"
                                alt="三星级" /></li>
                        <li>
                            <input type="radio" name="commodityScore" value="4" /><img src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/star04.gif"
                                alt="四星级" /></li>
                        <li>
                            <input type="radio" name="commodityScore" value="5" /><img src="<%=(new Web.Old_App_Code.TemplateLoad()).TemplateCssLoad() %>images/star05.gif"
                                alt="五星级" /><input id="btnScoreSubmit" class="submit" type="submit" value="提交评分" /></li>
                    </ul>
                </form>
            </div>
            <h3>
                发表评价</h3>
            <div class="tabcontain comment_list">
                <form id="formComment" action="" defaultbutton="btnGoodsComment">
                    <p>
                        <label for="txtaContent">
                            评价内容：</label><textarea id="txtaContent" rows="20" cols="20"></textarea><span id="spContent">*最多可输入200个字符</span></p>
                    <p>
                        <label for="txtContact">
                            联系方式：</label><input id="txtContact" name="contact" type="text" maxlength="50" /><span>
                                最多可输入50个字符</span></p>
                    <label for="txtCommentCode">
                        验证码：</label><input id="txtCommentCode" type="text" maxlength="4" /><img id="imgCheckCommentCode"
                            class="imgCode" src="/code.aspx?t=conmment" alt="看不清楚,换一张" onclick="this.src = '/code.aspx?a=' + Math.random();+'&t=conmment'" /><span
                                id="spCommentCode"></span>
                    <p>
                        <input id="btnGoodsComment" class="submit" type="submit" value="提交评价" /></p>
                </form>
            </div>
        </div>
        <span class="clear"></span>
    </div>
    <uc5:footer ID="Footer1" runat="server" />
</body>
</html>
